#include "arduinomega/HardwareSerial.h"
#include "arduinomega/WProgram.h"

extern "C" void __cxa_pure_virtual(){}
#define SONAR 2

int inchesAway;
int main()
{
	init();
	Serial.begin( 38400 ); // intialize serial baud rate

	while( true )
	{
		loop();
	}
	return 0;
}

void loop() {
  inchesAway = analogRead( SONAR ) / 2;

  Serial.print( "dist: ");
  Serial.print( inchesAway );
  Serial.print( "\n\r");
  delay( 1000 );
}
